/* 通用样式 - 黑白灰工业风 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --bg-hover: #333333;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #606060;
    --border-color: #333333;
    --accent-color: #ffffff;
    --error-color: #ff4444;
    --success-color: #00ff00;
    --warning-color: #ffaa00;
    --info-color: #00aaff;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}

/* 布局 */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 30px 25px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.logo-text h1 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.logo-text p {
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section-title {
    padding: 0 25px;
    font-size: 11px;
    color: var(--text-tertiary);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    gap: 12px;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-left-color: var(--accent-color);
}

.nav-item.active {
    background: var(--bg-tertiary);
    color: var(--accent-color);
    border-left-color: var(--accent-color);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.user-details h4 {
    font-size: 13px;
    font-weight: 500;
}

.user-details p {
    font-size: 11px;
    color: var(--text-secondary);
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.topbar {
    height: 70px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-left h2 {
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-color);
}

.content-area {
    padding: 40px;
}

/* 卡片 */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.card-body {
    padding: 25px;
}

/* 表单 */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 15px;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.3s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--bg-tertiary);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* 按钮 */
.btn {
    padding: 12px 24px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
}

.btn-primary {
    background: var(--accent-color);
    color: var(--bg-primary);
    border-color: var(--accent-color);
}

.btn-primary:hover {
    background: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255,255,255,0.2);
}

.btn-danger {
    border-color: var(--error-color);
    color: var(--error-color);
}

.btn-danger:hover {
    background: var(--error-color);
    color: var(--text-primary);
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.table td {
    font-size: 13px;
}

.table tr:hover {
    background: var(--bg-tertiary);
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid;
}

.badge-success {
    color: var(--success-color);
    border-color: var(--success-color);
}

.badge-error {
    color: var(--error-color);
    border-color: var(--error-color);
}

.badge-warning {
    color: var(--warning-color);
    border-color: var(--warning-color);
}

/* 消息提示 */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-left: 3px solid;
    font-size: 13px;
}

.alert-success {
    background: rgba(0, 255, 0, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(255, 68, 68, 0.1);
    border-color: var(--error-color);
    color: var(--error-color);
}

.alert-warning {
    background: rgba(255, 170, 0, 0.1);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.alert-info {
    background: rgba(0, 170, 255, 0.1);
    border-color: var(--info-color);
    color: var(--info-color);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-tertiary);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: 0.3s;
}

input:checked + .slider {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

input:checked + .slider:before {
    background-color: var(--bg-primary);
    transform: translateX(26px);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--accent-color);
}

/* 响应式 */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }
}

